package com.foton.springbootdemo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.Properties;

@SpringBootApplication(scanBasePackages = "com.foton.*")
@MapperScan(value = {"com.foton.order.mapper"})
public class SpringbootDemoApplication {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(SpringbootDemoApplication.class);
        springApplication.setAdditionalProfiles();
        Properties properties = new Properties();
        properties.setProperty("names","zhaoliu");
        springApplication.setDefaultProperties(properties);

        /**
         * 钩子函数，当程序停机后需要做一些处理的实现，可以钩子函数进处理
         */
        Runtime.getRuntime().addShutdownHook(new Thread(()->{
            System.out.println("jvm shutdown ==================================");

        }));

//        // 加载配置文件
//        JobConf jobConf = new JobConf();
//        jobConf.setConfigPath("classpath:job.yaml");
//
//        // 启动 Seatunnel 任务
//        SeaTunnelLauncher launcher = new SeaTunnelLauncher();
//        launcher.launch(jobConf);
//
//        // 等待任务完成
//        Thread.sleep(10000); // 示例，等待10秒后退出


        springApplication.run(args);



    }

}
